package org.ligson.fwc.api.enums;

public enum OsType {
    IOS(1, "IOS"), ANDROID(2, "ANDROID"), WIN(3, "windows"), LINUX(4, "linux"), MAC(5, "mac");
    private int code;
    private String msg;

    OsType(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static OsType getByCode(int code) {
        for (OsType osType : OsType.values()) {
            if (osType.getCode() == code) {
                return osType;
            }
        }
        throw new RuntimeException("code:" + code + "无效");
    }
}
